package mini.reanimate;

import audio.Audio;
import audio.Clip;

public class Caption {
	private final Clip sound;
	private final String caption;
	private final int frames;
	
	public Caption(String sound, String caption){
		this.sound = Audio.getClip(sound);
		this.caption = caption;
		frames = (int)((this.sound.getMillisecondLength() * .06) * 1.11);
	}
	
	public void play(){
		sound.play();
		Reanimate.me.caption(caption, frames);
	}

}
